#include"common.h"

int main()
{
  int fd = open(PATH_NAME,O_WRONLY);
  if(fd < 0)
  {
    perror("open");
    return 1;
  }
  while(1)
  {
    char buffer[64] = {0};
    printf("#");
    //从标准输入流读取字符串
    ssize_t s = read(0,buffer,sizeof(buffer)-1);
    if(s > 0)
    {
      //拿到了数据，写入管道
      //buffer[s-1] = 0;
      write(fd,buffer,strlen(buffer));
    } 
  }
  return 0;
}
